https://leetcode.cn/problems/sum-of-all-subset-xor-totals/description/
class Solution {
public:
    int path;
    int sum;
    void dfs(vector<int>& nums,int pos)
    {
        sum+=path^0;
        
        for(int i=pos;i<nums.size();i++)
        {
            path^=nums[i];
            dfs(nums,i+1);
            //还原
            path^=nums[i];
        }
    }

    int subsetXORSum(vector<int>& nums) {    
        dfs(nums,0);
        return sum;
    }
};